package vip.kqsy.cloud.ai.server.controller;

import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.kqsy.cloud.ai.server.pojo.dto.PageBySessionIdDTO;
import vip.kqsy.cloud.ai.server.pojo.vo.PageBySessionIdVO;
import vip.kqsy.cloud.ai.server.service.AiSessionHistoryService;
import vip.kqsy.cloud.core.web.res.R;
import vip.kqsy.cloud.core.web.res.ResPage;

/**
 * <p>
 * 对话历史表 前端控制器
 * </p>
 *
 * @author cenjunjie
 * @since 2023-07-08
 */
@RestController
@RequestMapping("/aiSessionHistory")
@RequiredArgsConstructor
public class AiSessionHistoryController {

    private final AiSessionHistoryService aiSessionHistoryService;

    @ApiOperation("查询对话列表")
    @GetMapping("pageBySessionId")
    public R<ResPage<PageBySessionIdVO>> pageBySessionId(PageBySessionIdDTO dto) {
        ResPage<PageBySessionIdVO> page = aiSessionHistoryService.pageBySessionId(dto);
        return R.ok(page);
    }
}
